import React, { useEffect, useRef, useState,forwardRef}  from "react";
import { Modal,Input,Cascader,Radio, message,Spin,Divider,Button} from 'antd';
import {CloudDownloadOutlined} from '@ant-design/icons'
import {addSubject} from 'api/index'
import LlxForm from 'components/LlxForm/index'
import AudioUpload from 'components/Upload/audio'
import UploadPicture from 'components/Upload/index'
import SubjectWord from 'components/LlxPushData/subjectWord'
const {SHOW_CHILD}=Cascader
const subjectTypeList = [
  {value:'1',label:'单选题', children: [{
    value: '5',
    label: '看图选文',
    subject:{
      titleText:false,
      titleAudio:false,
      titlePicture:true,
      optionsLength:2,
      optionsText:true,
      optionsAudio:false,
      optionsPicture:false,
      fixed:false,
    }
  }, {
    value: '3',
    label: '看文选文',
    subject:{
      titleText:true,
      titleAudio:false,
      titlePicture:false,
      optionsLength:3,
      optionsText:true,
      optionsAudio:false,
      optionsPicture:false,
      fixed:true,
    }
  }, {
    value: '2',
    label: '听音选图',
    subject:{
      titleText:false,
      titleAudio:true,
      titlePicture:false,
      optionsLength:2,
      optionsText:false,
      optionsAudio:false,
      optionsPicture:true,
      fixed:true,
    }
  }, {
    value: '10',
    label: '听音选音',
    subject:{
      titleText:true,
      titleAudio:true,
      titlePicture:false,
      optionsLength:2,
      optionsText:true,
      optionsAudio:true,
      optionsPicture:false,
      fixed:true,
    }
  },{
    value: '9',
    label: '看文选音',
    subject:{
      titleText:true,
      titleAudio:false,
      titlePicture:false,
      optionsLength:4,
      optionsText:false,
      optionsAudio:true,
      optionsPicture:false,
      fixed:true,
    }
  },{
    value: '1',
    label: '听音选文',
    subject:{
      titleText:true,
      titleAudio:true,
      titlePicture:false,
      optionsLength:3,
      optionsText:true,
      optionsAudio:false,
      optionsPicture:false,
      fixed:true,
    }
  },{
    value: '4',
    label: '看文选图',
    subject:{
      titleText:true,
      titleAudio:false,
      titlePicture:false,
      optionsLength:3,
      optionsText:false,
      optionsAudio:false,
      optionsPicture:true,
      fixed:true,
    }
  }]
}, {
  value: '2',
  label: '判断题',
  children: [{
    value: '1',
    label: '听音选文',
    subject:{
      titleText:true,
      titleAudio:true,
      titlePicture:true,
      optionsLength:0,
      optionsText:false,
      optionsAudio:false,
      optionsPicture:false,
      fixed:true,
    }
  }]
}, {
  value: '6',
  label: '识读题',
  children: [{
    value: '7',
    label: '看文跟读', 
    subject:{
      titleText:true,
      titleAudio:true,
      titlePicture:false,
      optionsLength:0,
      optionsText:false,
      optionsAudio:false,
      optionsPicture:false,
      fixed:true,
      answerHide:true
    }
  }]
}, {
  value: '7',
  label: '看图拼词',
  children: [{
    value: '5',
    label: '看图选文',
    subject:{
      titleText:false,
      titleAudio:false,
      titlePicture:true,
      optionsLength:5,
      optionsText:true,
      optionsAudio:false,
      optionsPicture:false,
      fixed:false,
    }
  }]
}, {
  value: '4',
  label: '排序题',
  children: [{
    value: '3',
    label: '看文选文',
    subject:{
      titleText:true,
      titleAudio:false,
      titlePicture:false,
      optionsLength:5,
      optionsText:false,
      optionsAudio:false,
      optionsPicture:false,
      fixed:false,
    }
  }, {
    value: '4',
    label: '看文选图',
    subject:{
      titleText:false,
      titleAudio:false,
      titlePicture:false,
      optionsLength:3,
      optionsText:false,
      optionsAudio:false,
      optionsPicture:true,
      fixed:false,
    }
  }]
}, {
  value: '5',
  label: '连线题',
  children: [{
    value: '2',
    label: '听音选图',
    subject:{
      titleText:false,
      titleAudio:false,
      titlePicture:false,
      optionsLength:4,
      optionsText:false,
      optionsAudio:true,
      optionsPicture:false,
      optionTwo:true,
      fixed:true,
    }
  }, {
    value: '4',
    label: '看文选图',
    subject:{
      titleText:false,
      titleAudio:false,
      titlePicture:false,
      optionsLength:4,
      optionsText:true,
      optionsAudio:false,
      optionsPicture:false,
      optionTwo:true,
      fixed:true,
    }
  }]
}
]

const getSort = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

const getIndex=(index) => {
  if (index === 0) return 'A'
  if (index === 1) return 'B'
  if (index === 2) return 'C'
  if (index === 3) return 'D'
  if (index === 4) return 'E'
  if (index === 5) return 'F'
  if (index === 6) return 'G'
  if (index === 7) return 'H'
  if (index === 8) return 'I'
  if (index === 9) return 'J'
  if (index === 10) return 'K'
  if (index === 11) return 'L'
  if (index === 12) return 'M'
  if (index === 13) return 'N'
  if (index === 14) return 'O'
  if (index === 15) return 'P'
  if (index === 16) return 'Q'
  if (index === 17) return 'R'
  if (index === 18) return 'S'
  if (index === 19) return 'T'
  if (index === 20) return 'U'
}

const NewSubject = forwardRef((props, ref) => {
  

  const {subjectItem,form,dictionaries} = props

  const [login,setLogin] = useState(false)
  const [optionIndex,setOptionIndex] = useState(null)
  const [refresh, setRefresh] = useState(false);
  const [isModalVisible,setIsModalVisible] = useState(false)

  useEffect(() => {
  refresh && setTimeout(() => setRefresh(false))
  }, [refresh])

    // 3.随机排序
    const getSortAnswer = () => {
      if (!form.getFieldValue().options||form.getFieldValue().options.some(i => !i.pictureUrlOld)) {
        message.error('选项未补全，无法排序')
        return
      }
      setLogin(true)
      const data = form.getFieldValue().options.map(i=>{
        return i.pictureUrlOld
      })
      data.sort(function(a, b) {
        return Math.random() - 0.5
      })
  
      const data1 = JSON.parse(JSON.stringify(form.getFieldValue().options))
  
      data1.forEach((i, index) => {
        i.pictureUrl = data[index]
      })
  
      form.setFieldsValue({
        ...form.getFieldValue,
        options:data1
      })
  
      let answer = []
      
      data1.forEach((i,j) => {
        answer.push(data.findIndex(x=>x===i.pictureUrlOld))
      })
  
      form.setFieldsValue({
        answerList:[{answer:answer.map(i=>getSort[i]).join(' ')}]
      })

      setTimeout(()=>{
        setLogin(false)
      },200)
    }
    // 4.看图拼词
    const spelling = (data) => {
      setLogin(true)
  
        const arr = Array(data.wordName.length).fill().map((i, index) => {
          return { optionName: data.wordName[index] }
        })
  
  
        const answerList = arr.sort(() => Math.random() - 0.5)

        form.setFieldsValue({
          ...form.getFieldValue,
          options:answerList
        })
    
  
        const listTrue = []
        const listFalse = []
        const list = []
  
        answerList.forEach((i, y) => {
          Array(data.wordName.length).fill().map((i, index) => {
            return { optionName: data.wordName[index] }
          }).forEach((x) => {
            if (x.optionName === i.optionName) {
              if (listFalse.some(z => z.i === i.optionName)) {
                !listFalse.filter(z => z.i === i.optionName)[0].index.includes(y) && listFalse.filter(z => z.i === i.optionName)[0].index.push(y)
              } else {
                listFalse.push({ index: [y], i: i.optionName })
              }
            }
          })
        })
        answerList.forEach(i => {
          Array(data.wordName.length).fill().map((i, index) => {
            return { optionName: data.wordName[index] }
          }).forEach((x, y) => {
            if (x.optionName === i.optionName) {
              if (listTrue.some(z => z.i === i.optionName)) {
                !listTrue.filter(z => z.i === i.optionName)[0].index.includes(y) && listTrue.filter(z => z.i === i.optionName)[0].index.push(y)
              } else {
                listTrue.push({ index: [y], i: i.optionName })
              }
            }
          })
        })
        Array(data.wordName.length).fill().map((i, index) => {
          return { optionName: data.wordName[index] }
        }).forEach(i => {
          list.push(listFalse.filter(x => i.optionName === x.i).map(y => y))
        })
        list.forEach(i => {
          i[0].index.map(x => getIndex(+x))
        })
        var value = 1
        list.map(i => {
          return i[0].index.map(x => getIndex(+x))
        }).forEach(i => {
          value = i.length * value
        })
  
        var sarr = [[]]
        for (var i = 0; i < list.map(i => {
          return i[0].index.map(x => getIndex(+x))
        }).length; i++) {
          var tarr = []
          for (var j = 0; j < sarr.length; j++) {
            for (var k = 0; k < list.map(i => {
              return i[0].index.map(x => getIndex(+x))
            })[i].length; k++) {
              tarr.push(sarr[j].concat(list.map(i => {
                return i[0].index.map(x => getIndex(+x))
              })[i][k]))
            }
          }
          sarr = tarr
        }
  
        sarr.map(i => {
          const a = []
          i.forEach(x => {
            if (a.includes(x)) {
              return false
            } else {
              a.push(x)
            }
          })
          return i
        })
        const ssarr = []
        sarr.forEach(i => {
          const a = []
          let b = false
          i.forEach(x => {
            if (a.includes(x)) {
              b = true
            } else {
              a.push(x)
            }
          })
          if (!b) {
            ssarr.push(i)
          }
        })
        
        form.setFieldsValue({
          answerList:[{answer:ssarr.map(i => {
            return i.join(' ')
          }).join(',')}]
        })
        setTimeout(()=>{
          setLogin(false)
        },200)
    }
    // 5.导入单词
    const importData = (a,b) => {
      if(form.getFieldValue().type[0]==='7'){
        if(a.type!==1) {
          message.error('请导入全部')
          return
        }
        if(subjectItem.titlePicture){
          form.setFieldsValue({
            pictureUrl:a.pictureUrl
          })
        }
  
        spelling({wordName:a.wordName})
  
        setIsModalVisible(false)
        
        return
      }
  
      setLogin(true)
      if(optionIndex===null){
        switch(a.type){
          case 1:
           if(subjectItem.titleAudio){
             form.setFieldsValue({
               audioUrl:a.audioUrl
             })
           }
           if(subjectItem.titlePicture){
             form.setFieldsValue({
               pictureUrl:a.pictureUrl
             })
           }
           if(subjectItem.titleText){
             form.setFieldsValue({
              subjectName:a.wordName
             })
           }
          break
          case 2:
            if(subjectItem.titleAudio){
              form.setFieldsValue({
                audioUrl:a.audioUrl
              })
            }
          break
          case 3:
            if(subjectItem.titlePicture){
              form.setFieldsValue({
                pictureUrl:a.pictureUrl
              })
            }
          break
          default:
          return
        }
      } else {
        switch(a.type){
          case 1:
            const data = JSON.parse(JSON.stringify(form.getFieldValue().options))

            form.setFieldsValue({
              options:data.map((i,j)=>{
                if(j===optionIndex){
                  if(subjectItem.optionsAudio){
                    i.optionAudio=a.audioUrl
                  }
                  if(subjectItem.optionsPicture){
                    i.optionPicture=a.pictureUrl
                  }
                  if(subjectItem.optionsText){
                    i.optionName=a.wordName
                  }
                  if(subjectItem.optionTwo){
                    i.pictureUrlOld=a.pictureUrl
                 }
                }
                return i
              })
            })
          break
          case 2:
            const data1 = JSON.parse(JSON.stringify(form.getFieldValue().options))

            form.setFieldsValue({
              options:data1.map((i,j)=>{
                if(j===optionIndex){
                  if(subjectItem.optionsAudio){
                    i.optionAudio=a.audioUrl
                  }
                }
                return i
              })
            })
          break
          case 3:
            const data2 = JSON.parse(JSON.stringify(form.getFieldValue().options))

            form.setFieldsValue({
              options:data2.map((i,j)=>{
                if(j===optionIndex){
                  if(subjectItem.optionsPicture){
                    i.optionPicture=a.pictureUrl
                  }
                  if(subjectItem.optionTwo){
                    i.pictureUrlOld=a.pictureUrl
                 }
                }
                return i
              })
            })
          break
          default:
          return
        }
      }
      setTimeout(()=>{
        setLogin(false)
      },200)
      setIsModalVisible(false)
    }
    // 6.导入题干
    const importWordData = () => {
      setOptionIndex(null)
      setIsModalVisible(true)
    }
    // 7.导入选项
    const importWordOption = (value) => {
      console.log(value);
      setOptionIndex(value)
      setIsModalVisible(true)
    }
    // 输入框
    const checkText =(e,i)=>{
      i.optionName=e.target.value
      e.target.value=i.optionName
      setRefresh(true)
    }
    // 题干输入
    const checkTextTitle = (e) => {
      form.setFieldsValue({...form.getFieldValue,subjectName:e.target.value})
      setRefresh(true)
    }
    // 答案输入
    const checkTextAnswer = (e) => {
      form.setFieldsValue({...form.getFieldValue,answerList:[{answer:e.target.value}]})
      setRefresh(true)
    }
    const onChangeAnswer = () => {}

   
  return form.getFieldValue().type?<div className="add-edit-subject">
    {/* 新建题目 */}

    <div className="subject">
    {/* 题干图片 */}
    {
      subjectItem.titlePicture?<div>
      <span>题干图片</span>
       <UploadPicture pictureUrl={form.getFieldValue().pictureUrl} setPhoto={(value)=>form.setFieldsValue({...form.getFieldValue(),pictureUrl:value})}></UploadPicture>
      </div>:''
    }
    {/* 题干音频 */}
    {
      subjectItem.titleAudio?<div>
      <span>题干音频</span>
      <AudioUpload  audio={form.getFieldValue().audioUrl} style={{marginLeft:'20px'}} setAudio={value=>form.setFieldsValue({...form.getFieldValue(),audioUrl:value})}></AudioUpload>
      </div>:''
    }
    {/* 题干文字 */}
    {
      subjectItem.titleText?<div>
      <span>题干文字</span>
      <Input value={form.getFieldValue().subjectName} onChange={e=>checkTextTitle(e)} placeholder={'请输入题干文字'}></Input>
      </div>:''
    }
     {
      subjectItem.titlePicture||subjectItem.titleAudio?<div>
        <Button type={'primary'} size={'small'} onClick={importWordData}>单词库导入</Button>
      </div>:''
    }
   </div>
   <Divider></Divider>
    <Spin tip="Loading..." spinning={login}>

   {
     form.getFieldValue().options.length?<div className="option">
     {
      form.getFieldValue().options.map((i,j)=>{
       return <div key={j}>
           {/* 选项图片 */}
           {
             subjectItem.optionsPicture?<div>
               <span>选项图片</span>
               <UploadPicture pictureUrl={i.optionPicture} setPhoto={(value)=>i.optionPicture=value}></UploadPicture>
             </div>:''
           }
           {/* 选项音频 */}
           {
             subjectItem.optionsAudio?<div>
                <span>选项音频</span>
               <AudioUpload  audio={i.optionAudio} style={{marginLeft:'20px'}} setAudio={value=>i.optionAudio=value}></AudioUpload>
             </div>:''
           }
           {/* 选项文字 */}
           {
             subjectItem.optionsText?<div>
                <span>选项文字</span>
               <Input value={i.optionName} onChange={e=>checkText(e,i)}  placeholder={'请输入选项文字'}></Input>
             </div>:''
           }
          {
                (subjectItem.optionsPicture||subjectItem.optionsAudio||subjectItem.optionsText) && form.getFieldValue().type[0]!=='7'?<div style={{marginTop:'20px'}}>
                <Button  shape="circle" icon={<CloudDownloadOutlined />}  type={'primary'} size={'large'} onClick={()=>importWordOption(j)}></Button>
              </div>:''
           }
       </div>
     })
     }
   </div>:''
   }

   {
     form.getFieldValue().type[0]==='5'?<div className="option">
     {
       form.getFieldValue().options.map((i,j)=>{
       return <div key={j}>
           {/* 选项图片 */}
           {
             <div>
               <span>对应图片</span>
               <UploadPicture pictureUrl={i.pictureUrlOld} setPhoto={(value)=>i.pictureUrlOld=value}></UploadPicture>
             </div>
           }
       </div>
     })
     }

    
   </div>:''
   }

   {
    form.getFieldValue().type[0]==='5'?<div className="text-link" onClick={getSortAnswer}>
      随机打乱生成答案
    </div>:''
   }
   
   {
    form.getFieldValue().type[0]==='5'? form.getFieldValue().type[0]==='5'?<div className="option">
    {
     form.getFieldValue().options.map((i,j)=>{
      return <div key={j}>
          {/* 选项图片 */}
          {
            <div>
              <span>打乱后图片</span>
              <UploadPicture disabled pictureUrl={i.pictureUrl} setPhoto={(value)=>i.pictureUrl=value}></UploadPicture>
            </div>
          }
      </div>
    })
    }
   </div>:'':''
   }

    {
      subjectItem.answerHide||   form.getFieldValue().type[0]==='1'||form.getFieldValue().type[0]==='2'?'':<div className="answer">
       <span className="text-color-red">*</span><span>请输入题目答案:</span><Input  placeholder="请输入答案,存在多个答案以英文逗号分隔,例如 A B C,B A C"  onChange={e=>checkTextAnswer(e)}  value={form.getFieldValue().answerList?form.getFieldValue().answerList[0].answer:''}></Input>
    </div>
    }

{
       form.getFieldValue().type[0]==='1'?<div className="answer">
       <span className="text-color-red">*</span><span>请选择答案:</span>
       <Radio.Group onChange={e=>form.setFieldsValue({...form.getFieldValue,answerList:[{answer:e.target.value}]})} defaultValue={form.getFieldValue().answerList?form.getFieldValue().answerList[0].answer:'A'}>
       {
         getSort.slice(0, form.getFieldValue().options.length)?.map(i=>{
           return  <Radio value={i} key={i}>{i}</Radio>
         })
       }
      </Radio.Group>
    </div>:''
    }

    {
      form.getFieldValue().type[0]==='2'?<div style={{marginTop:'20px'}}>
       <span className="text-color-red">*</span> 请选择题目答案: <Radio.Group defaultValue={form.getFieldValue().answerList[0].answer} onChange={e=>form.setFieldsValue({...form.getFieldValue,answerList:[{answer:e.target.value}]})}>
      <Radio value={'true'}>正确</Radio>
      <Radio value={'false'}>错误</Radio>
    </Radio.Group>
    </div>:''
    }

<SubjectWord isModalVisible={isModalVisible} setIsModalVisible={setIsModalVisible} dictionaries={dictionaries} importData={importData}></SubjectWord>

  </Spin>


</div>:<div style={{marginLeft:'550px'}}>请先选择题目模板 !</div>
})



const AddOrEditSubject = (props) => {

  const {isModalVisible, setIsModalVisible,form,dictionaries} = props

  const [examination,setExamination]=useState([])

  useEffect(()=>{
    setExamination(form.getFieldValue().examinationName||[])
    if(!form.getFieldValue().type) return
    setSubjectItem(subjectTypeList.filter(i=>i.value===form.getFieldValue().type[0])[0].children.filter(i=>i.value===form.getFieldValue().type[1])[0].subject)
  }, [isModalVisible]) // eslint-disable-line react-hooks/exhaustive-deps

  const [subjectItem,setSubjectItem]=useState([])

  const options = useRef()
  const newItem = [
  {label: '题型', name: 'type', span: 6 ,rules:[
    {
      required: true,
      message: '请输入题目模板'
    },
  ],render:()=>{
    return <Cascader disabled fieldNames={{value:'value',label:'label'}}  options={subjectTypeList}  placeholder={'请选择对应的题目模板'}/>
  }},
    {label: '标签', name: 'label' , span: 6 ,render: () => {
      return <Cascader  maxTagCount="responsive" showCheckedStrategy={SHOW_CHILD} fieldNames={{value:'id',label:'labelName'}} options={dictionaries.Label} multiple placeholder="请选择标签" />
  }},
  {label: '背景音乐', name: 'backgroundMusic', span: 7 ,render:()=>{
    return  <AudioUpload  audio={form.getFieldValue().backgroundMusic} style={{marginLeft:'20px'}} setAudio={value=>form.setFieldsValue({...form.getFieldValue(),backgroundMusic:value})}></AudioUpload>
  }},
  {label: '引导文字',type:'input',name: 'guideText', span: 6},
  {label: '引导语音', name: 'guideAudio', span: 6 ,render:()=>{
    return  <AudioUpload  audio={form.getFieldValue().guideAudio} style={{marginLeft:'20px'}} setAudio={value=>form.setFieldsValue({...form.getFieldValue(),guideAudio:value})}></AudioUpload>
  }},
  {label: '解析文字',type:'input',name: 'analysisText', span: 6},
  {label: '解析语音', name: 'analysisAudio', span: 6 ,render:()=>{
    return  <AudioUpload  audio={form.getFieldValue().analysisAudio} style={{marginLeft:'20px'}} setAudio={value=>form.setFieldsValue({...form.getFieldValue(),analysisAudio:value})}></AudioUpload>
  }},
  {label: '考点种类', name: 'examinationTypeId' , span: 6 ,rules:[
    {
      required: true,
      message: '请输入选择考点种类'
    },
  ],render: () => {
    return <Cascader disabled  maxTagCount="responsive"  showCheckedStrategy={SHOW_CHILD} fieldNames={{value:'id',label:'dictValue'}} options={dictionaries.SubjectType} multiple placeholder="请选择种类" />
}},
{label: '', name: 'examinationNamebb' , span: 18 ,render: () => {
  return <div className="examination-form">
  {examination?.map(i=>{
    return <div key={i.examinationTypeId} >
      {i.examinationTypedName}:
    <Input defaultValue={i.examination} onChange={e=>i.examination=e.target.value} placeholder={'请输入考点'}></Input>
    </div>
  })}
  </div>
}}
]


  // 返回
  const handleOk = async () => {

   const {label,id,globalOriginType,paperBookId,sort,examinationTypeId,type,guideAudio,guideText,subjectName,pictureUrl,audioUrl,analysisAudio,analysisText,backgroundMusic}=form.getFieldValue()
    

   
    
    // 发送请求
    form.validateFields().then(async()=>{


          
    let answerList = form.getFieldValue().answerList

    const value = answerList[0].answer.indexOf(',')!==-1
  
    const value1 = answerList[0].answer.indexOf(',')!==-1?answerList[0].answer.split(',').filter(i=>i).map(i=>{
      return i.split('').filter(x=>x).join(' ')
    }).join(','):''

   if(type[0]==='7' && value){
    //  看图拼词
    answerList=[
      {
        answer:value1
      }
    ]
   } else if(type[0]==='4'&&type[1]==='3'&&value){
   // 排序题
   answerList=[
     {
      answer:value1
     }
    ]
   }

   if(type[0]!=='5'&&type[0]!=='7'){
    if(!answerList||!answerList[0]||!answerList[0].answer){
      message.error('检测到你未填写答案')
      return
    }
  }

  if(type[0]==='1'){
    if(answerList[0].answer.trim().length!==1){
      message.error('检测到你答案可能有误，检查后再提交')
      return
    }
  }
  

  if(subjectItem.titleText&&!subjectName){
    message.error('是不是题目文字未填写？？？？')
    return
  }
  if(subjectItem.titleAudio&&!audioUrl){
    message.error('是不是题目音频未上传？？？？')
    return
  }
  if(subjectItem.titlePicture&&!pictureUrl){
    message.error('是不是题目图片未上传？？？？')
    return
  }

      const params = {
        analysisAudio,
        analysisText,
        answerList,
        audioUrl,
        backgroundMusic,
        examination: examination,
        examinationTypeId,
        globalOriginType: globalOriginType,
        guideAudio,
        guideText,
        id,
        labels: label?.map(i=>{
          return {id:i[1]}
        }),
        options: form.getFieldValue().options,
        paperBookId: paperBookId,
        pictureUrl,
        sort: sort,
        subjectName,
        subjectType: type[1],
        type: type[0],
      }

      await addSubject(params)

      message.success("修改成功")

      setIsModalVisible(false);

      props.getInfoFn()
    })
  }
  const onCancel = () => {
    setIsModalVisible(false);
  };

   
  return   <Modal wrapClassName={'subject-add'}  width={1200} title={'编辑题目'} destroyOnClose  visible={isModalVisible} onOk={handleOk} onCancel={onCancel}>
      

      <LlxForm form={form} labelCol={7} formItem={newItem} />

      

      <NewSubject dictionaries={dictionaries} ref={options} form={form} subjectItem={subjectItem}></NewSubject>

   </Modal>

}
export default AddOrEditSubject